home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Mail / pine3.92 / pine / cmplhelp.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1996-03-14  |  2KB  |  72 lines

  1. #!/bin/sh
  2. #
  3. # $Id: cmplhelp.sh,v 4.4 1996/03/15 07:13:42 hubert Exp $
  4. #
  5. #            T H E    P I N E    M A I L   S Y S T E M
  6. #
  7. #   Laurence Lundblade and Mike Seibel
  8. #   Networks and Distributed Computing
  9. #   Computing and Communications
  10. #   University of Washington
  11. #   Administration Building, AG-44
  12. #   Seattle, Washington, 98195, USA
  13. #   Internet: lgl@CAC.Washington.EDU
  14. #             mikes@CAC.Washington.EDU
  15. #
  16. #   Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  17. #
  18. #
  19. #   Pine and Pico are registered trademarks of the University of Washington.
  20. #   No commercial use of these trademarks may be made without prior written
  21. #   permission of the University of Washington.
  22. #
  23. #   Pine, Pico, and Pilot software and its included text are Copyright
  24. #   1989-1996 by the University of Washington.
  25. #
  26. #   The full text of our legal notices is contained in the file called
  27. #   CPYRIGHT, included with this distribution.
  28. #
  29. #
  30. #   Pine is in part based on The Elm Mail System:
  31. #    ***********************************************************************
  32. #    *  The Elm Mail System  -  Revision: 2.13                             *
  33. #    *                                                                     *
  34. #    *             Copyright (c) 1986, 1987 Dave Taylor               *
  35. #    *             Copyright (c) 1988, 1989 USENET Community Trust    *
  36. #    ***********************************************************************
  37. #
  38.  
  39.  
  40. # cmplhelp.sh -- This script take the pine.help file and turns it into
  41. # a .c file defining lots of strings
  42. #
  43.  
  44.  
  45. awk 'BEGIN         {in_text = 0;
  46.                     count = 0;
  47.                     printf("#include <stdio.h>\n\n\n")
  48.                    }
  49.  
  50.  
  51.      /^====/       { if(in_text)
  52.                          printf("NULL\n};\n\n\n");
  53.                      printf ("char *%s[] = {\n ", $2 );
  54.                      texts[count++] = $2;
  55.                      in_text = 1;
  56.                     }
  57.      /^$/           { if(in_text)
  58.                           printf("\" \",\n");
  59.                     }
  60.      /^[^====]/     { if(in_text)
  61.                           printf("\"%s\",\n", $0);
  62.                     }
  63.      END            { if(in_text)
  64.                           printf("NULL\n};\n\n");
  65.                       printf("char **h_texts[] = {\n");
  66.                       for(i = 0; i < count; i++)
  67.                           printf("%s,\n",texts[i]);
  68.                       printf("NULL\n};\n\n");
  69.                     } '
  70.